import request from '@/utils/httpRequest'
// 获取所有角色
export function GetAllrole(query) {
  return request({
    url: '/sys/rolegroup/list',
    method: 'get',
    params: query
  })
}

// 创建角色
export function CreateRole(query) {
  // headers: {'Content-Type': 'application/x-www-form-urlencoded'}
//  var new_data = qs.stringify(query)
  return request({
    url: '/sys/rolegroup/save',
    method: 'post',
    headers: {
      'Content-Type': 'text/plain'
    },
    params: query
  })
}

// 删除角色
export function DelRole(query) {
  // var new_data = qs.stringify(query);
  // console.log("del)))))))))))))")
  // console.log(new_data)
  // console.log(query)
  console.log('qqqqqqqqqqq')
  console.log(request.adornData(query, false))
  return request({
    url: '/sys/rolegroup/delete',
    method: 'post',
    data: request.adornData(query, false)
  })
}

// 获取菜单
// get/sys/menu/list
export function getMenuList() {
  return request({
    url: '/sys/menu/list',
    method: 'get'
  })
}

// 获取 角色详情

export function getRoleDetail(id) {
  return request({
    url: '/sys/rolegroup/info/' + id,
    method: 'get'
  })
}

// 获取管理员 分组列表 无分页
// /sys/rolegroup/select
export function getAllRole() {
  return request({
    url: '/sys/rolegroup/select/',
    method: 'get'
  })
}
